package com.ftwj.demo.modular.entity;

import java.io.Serializable;
import java.util.Date;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;

import com.ftwj.demo.base.annotation.Column;
import com.ftwj.demo.base.annotation.Order;
import com.ftwj.demo.base.annotation.Primarykey;
import com.ftwj.demo.base.annotation.QueryTable;
import com.ftwj.demo.base.annotation.Table;
import com.ftwj.demo.base.annotation.Transient;
import com.ftwj.demo.base.constant.Const;
import com.ftwj.demo.base.constant.QueryModel;
import com.ftwj.demo.utils.validate.ValidateGroupKey;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;

/**
*
* <p>Title: ScheduleJobBean</p>  
* <p>Description: 描述</p>
* <p>Copyright: Copyright (c) 2020 </p>  
* <p>Company: 兰州飞天网景信息产业有限公司</p>    
* @author WangSli
* @date 2020年04月16日 14:02:35
* @version V1.0
*/
@Data
@Table(name="tb_schedule_job")
@Accessors(chain=true)
@ApiModel(value="ScheduleJobBean对象", description="")
public class ScheduleJobBean implements Serializable {

	/** serialVersionUID*/ 
	private static final long serialVersionUID = 1L;
	
	@NotNull(groups=ValidateGroupKey.class)
 	@Primarykey(name="job_id")
	@ApiModelProperty(value = "任务ID")
	private Integer jobId;
	@NotBlank(message = "任务名称不能为空")
	@ApiModelProperty(value = "任务名称")
	@QueryTable(model=QueryModel.ALL_LIKE)
	private String name;
	@NotBlank(message = "任务分组不能为空")
	@ApiModelProperty(value = "任务分组")
	@QueryTable(model=QueryModel.ALL_LIKE)
	private String group;
	@NotBlank(message = "任务运行时间表达式不能为空")
	@ApiModelProperty(value = "任务运行时间表达式")
	private String cron;
	@ApiModelProperty(value = "定时任务处理类")
	@Column(name="class_name")
	private String className;
	@ApiModelProperty(value = "方法参数")
	private String params;
	@ApiModelProperty(value = "描述信息")
	private String description;
	@Column(name="create_user")
	@ApiModelProperty(value = "创建人")
	private Integer createUser;
	@Column(name="create_time")
	@ApiModelProperty(value = "创建时间",hidden = true)
	@Order(order=Const.ORDER_DESC,sort=1)
	private Date createTime;
	@ApiModelProperty(value = "任务状态 -1停止 0暂停 1启用")
	@Order(order=Const.ORDER_DESC,sort=0)
	private Integer state;
	
	@Transient
	private String triggerState;//调度器中定时器状态
	
}